package com.vehicle.controller;

import com.vehicle.service.TotalPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("price")
public class TotalPriceController {

    @Autowired
    private TotalPriceService totalPriceService;

    @RequestMapping("totalprice")
    @ResponseBody
    public Map<String,Integer> findAllTotalPrice(){
        return totalPriceService.allTotalPrice();
    }

    @RequestMapping("totalPriceByCarid")
    @ResponseBody
    public Map<String,Integer> findTotalPriceByCarid(Integer carid){
        return totalPriceService.findAllTotalPriceByCarid(carid);
    }




}
